/**
 * 
 */
package de.guidoludwig.jtm;

import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Environment;
import org.hibernate.tool.hbm2ddl.SchemaExport;

import de.guidoludwig.jtm.domain.Archive;
import de.guidoludwig.jtm.domain.Artist;
import de.guidoludwig.jtm.domain.Show;

/**
 * @author guido
 *
 */
@SuppressWarnings("deprecation")
public class JTMSchemaExport {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		AnnotationConfiguration configuration = new AnnotationConfiguration();

		configuration
		.addAnnotatedClass(Artist.class)
		.addAnnotatedClass(Archive.class)
		.addAnnotatedClass(Show.class)
		.setProperty(Environment.DIALECT, "de.guidoludwig.jtm.server.SQLiteDialect")
		.setProperty(Environment.DRIVER, "org.sqlite.JDBC");

		SchemaExport schema = new SchemaExport(configuration);
		schema.setOutputFile("schema.sql");

		schema.create(true, false);
	}

}
